package com.hulk.rpc.server;

import com.hulk.rpc.common.HulkConnectService;
import com.hulk.rpc.invoke.ServiceInvokeFactory;

import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

/**
 * @author xuxukang
 * @date 2019/9/3 17:31
 */
public class HulkConnectServiceImpl implements HulkConnectService {

  private final ServiceInvokeFactory invokerFactory;

  public HulkConnectServiceImpl(ServiceInvokeFactory serviceInvokeFactory) {
    this.invokerFactory = serviceInvokeFactory;
  }

  @Override
  public CompletableFuture<List<String>> getClassRegisterList() {
    return CompletableFuture.completedFuture(invokerFactory.getClassRegisterList());
  }

  @Override
  public CompletableFuture<Map<String, Integer>> getMethodRegisterMap() {
    return CompletableFuture.completedFuture(invokerFactory.getMethodRegisterMap());
  }

  @Override
  public CompletableFuture<List<String>> getRestRegisterList() {
    return CompletableFuture.completedFuture(invokerFactory.getRestRegisterList());
  }

  @Override
  public CompletableFuture<Map<String, Integer>> getClassIdMap() {
    return CompletableFuture.completedFuture(invokerFactory.getClassIdMap());
  }
}
